package all_router

import (
	"chaowan/controller/admin"
	"chaowan/controller/user"
	"github.com/gin-gonic/gin"
)

// 总路由
func InitRouter(router *gin.Engine) {
	rl := NewRateLimiter(5, 6)
	admin_group := router.Group("/admin")
	admin.Router(admin_group)

	user_group := router.Group("/user")
	user.Router2(user_group)

	auth_user_group := user_group.Use(HelloMiddleware(rl))
	user.Router(auth_user_group)

}
